#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unit test for labman2 installation and site pages using the unittest module
and Robot Framework. These will pass when you run "manage.py test".
"""

from django.test import TestCase
import sys
import django
import os
from os.path import join, abspath, dirname

ROOT_ROBOTTESTS = abspath(join(dirname(__file__), ".."))

class InstallTest(TestCase):
    """Test installed packages"""

    def test_base_install(self):
        """Are Python, django, gettext packages installed?"""

        #Python installed and it's version >= 2.4
        self.failUnless(sys.version_info >= (2, 4))

        #Django installed
        self.assertTrue('django' in sys.modules)
        self.failUnless(django.get_version() >= '1.6')

        #gettext
        self.assertTrue('gettext' in sys.modules)


os.system("pybot --outputdir " +
          join(ROOT_ROBOTTESTS, "RobotTests", "output_Firefox") + " " +
          join(ROOT_ROBOTTESTS, "RobotTests", "tests"))
